/*-----------------------------------------------------------------------------
 * stock_server.h - Header for main stock server routines and statistics data
 *                  structures
 *
 * March 2010, Forhad Ahmed
 *-----------------------------------------------------------------------------
 */

#ifndef _STOCK_SERVER_
#define _STOCK_SERVER_

#include <pthread.h>
#include "common/include/stock_common.h"
#include "server/include/stock_server_stream.h"
#include "server/include/stock_server_dgram.h"

/*
 *
 */
#define STOCK_SERVER_DGRAM  0x01
#define STOCK_SERVER_STREAM 0x02


/*
 *
 */
typedef struct stock_server_netstats_t {
    uint8_t               server_type;
    stock_stream_stats_t *stream_stats;
    stock_dgram_stats_t  *dgram_stats;
} stock_server_netstats_t;


/*
 *
 */
extern stock_server_netstats_t stock_server_netstats;


/*
 *
 */
extern pthread_t stock_server_thread;


/*
 *
 */
void *
stock_server(void *arg);


/*
 *
 */
void
stock_server_shutdown(int arg);

#endif /* _STOCK_SERVER_ */
